package com.useeinfo.oa.modules.inspection.biz;

import com.useeinfo.framework.extend.biz.CrudBiz;
import com.useeinfo.framework.sugar.data.QueryParam;
import com.useeinfo.oa.modules.inspection.dao.InspectionExecuteTimeDao;
import com.useeinfo.oa.modules.inspection.entity.InspectionExecuteTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 */
@Service("inspectionExecuteTimeBiz")
public class InspectionExecuteTimeBiz extends CrudBiz<InspectionExecuteTimeDao, InspectionExecuteTime> {
    @Autowired
    private InspectionExecuteTimeDao inspectionExecuteTimeDao;
    public Integer setOperateStatus(int status,Long id){
        return inspectionExecuteTimeDao.setOperateStatus(status,id);
    }
    public void deleteTime(Long id){
         dao.deleteTime(id);
    }


    public List<InspectionExecuteTime> createOrder(String remindTime) {
        QueryParam queryParam = new QueryParam();
        queryParam.getSqlMap().put("remindTime", remindTime);
        queryParam.getSqlMap().put("status", "0");
        queryParam.getSqlMap().put("operateStatus", "1");
        List<InspectionExecuteTime> inspectionExecuteTimeList = dao.findList(queryParam);
        if (!CollectionUtils.isEmpty(inspectionExecuteTimeList)) {
            return inspectionExecuteTimeList;
        }
        return null;
    }


}
